home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / Applet Toolkit / appletdefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-11  |  3.4 KB  |  203 lines  |  [TEXT/KAHL]

  1.  
  2.  
  3. #define appletdefsinclude /*so other modules can tell if we've been included*/
  4.  
  5.  
  6. #define macintosh
  7.  
  8. #undef windows
  9.  
  10.  
  11. #ifdef macintosh
  12.     
  13.     #ifdef MPWC
  14.         
  15.         #include <types.h>
  16.         #include <resources.h>
  17.         #include <dialogs.h>
  18.         #include <menus.h>
  19.         #include <fonts.h>
  20.         #include <events.h>
  21.         #include <controls.h>
  22.         #include <segload.h>
  23.         #include <memory.h>
  24.         #include <toolutils.h>
  25.         #include <packages.h>
  26.         #include <sound.h>
  27.         #include <files.h>
  28.         #include <desk.h>
  29.     
  30.     #endif
  31.     
  32.     
  33.     #define widthsmallicon 16 /*dimensions of a SICN resource*/
  34.     #define heightsmallicon 16
  35.  
  36.     typedef ControlHandle hdlscrollbar;
  37.     
  38.     #define quickdrawglobal(x) qd.x
  39.     
  40.     #define sizegrowicon 15 /*it's square, this is the length of each side*/
  41.      
  42.     #define dragscreenmargin 4 /*for dragging windows, leave this many pixels on all sides*/
  43.     
  44.     #define doctitlebarheight 18 /*number of pixels in the title bar of each standard window*/
  45.  
  46.     #define lenbigstring 255
  47.        
  48.     #define OsType OSType
  49.     
  50.     #define boolean short
  51.     
  52.     #define bigstring Str255
  53.     
  54.     typedef unsigned char *ptrstring, **hdlstring;
  55.     
  56.     #define sysbeep SysBeep(1) 
  57.     
  58.     #define    stringlength(bs) ((bs)[0])
  59.     
  60.     #define setstringlength(bs,len) (bs[0]=(char)len)
  61.     
  62.     #define setstringwithchar(ch,bs) {bs[0]=1;bs[1]=ch;}
  63.     
  64.     #define setemptystring(bs) (setstringlength(bs,0))
  65.     
  66.     #define isemptystring(bs) (stringlength(bs)==0)
  67.     
  68.     #define isemptyrect(r) EmptyRect (&r)
  69.     
  70.     #include <Printing.h>
  71.     
  72. #endif
  73.  
  74.  
  75.  
  76.  
  77.  
  78. #define true 1
  79. #define false 0
  80.  
  81. #define infinity 32767
  82. #define longinfinity (long)0x7FFFFFFF
  83. #define intinfinity 32767
  84. #define intminusinfinity -32766
  85.  
  86. #define emptystring (ptrstring) "\p"
  87.  
  88. #define chnul            ((char) 0)
  89. #define chbacktab        ((char) 0)
  90. #define chhome             ((char) 1)
  91. #define chenter            ((char) 3)
  92. #define chend             ((char) 4)
  93. #define chhelp             ((char) 5)
  94. #define chbackspace        ((char) 8) 
  95. #define chtab             ((char) 9)
  96. #define chlinefeed        ((char) 10)
  97. #define chpageup         ((char) 11)
  98. #define chpagedown         ((char) 12)
  99. #define chreturn        ((char) 13)
  100. #define chescape        ((char) 27)
  101. #define chrightarrow     ((char) 29)
  102. #define chleftarrow     ((char) 28)
  103. #define chuparrow         ((char) 30)
  104. #define chdownarrow     ((char) 31)
  105. #define chsinglequote     ((char) 39)
  106. #define chdoublequote     ((char) 34)
  107. #define chspace            ((char) 32)
  108. #define chdelete         ((char) 127)
  109.  
  110.  
  111. typedef enum tydirection { /*the possible values for a Toolkit direction parameter*/
  112.     
  113.     nodirection = 0, 
  114.     
  115.     up = 1, 
  116.     
  117.     down = 2, 
  118.     
  119.     left = 3,
  120.     
  121.     right = 4, 
  122.     
  123.     flatup = 5, 
  124.     
  125.     flatdown = 6, 
  126.     
  127.     sorted = 8,
  128.     
  129.     pageup = 9,
  130.     
  131.     pagedown = 10,
  132.     
  133.     pageleft = 11,
  134.     
  135.     pageright = 12
  136.     } tydirection;
  137.  
  138.  
  139. #define ctdirections 12 /*the number of directions, for looping and arrays*/
  140.  
  141.  
  142. typedef enum tyjustification {
  143.     
  144.     leftjustified, 
  145.     
  146.     centerjustified, 
  147.     
  148.     rightjustified,
  149.     
  150.     fulljustified,
  151.     
  152.     unknownjustification
  153.     } tyjustification;
  154.     
  155.     
  156. typedef enum tylinespacing {
  157.     
  158.     singlespaced = 1,
  159.     
  160.     oneandalittlespaced = 2,
  161.     
  162.     oneandaquarterspaced = 3,
  163.     
  164.     oneandahalfspaced = 4,
  165.     
  166.     doublespaced = 5,
  167.     
  168.     triplespaced = 6
  169.     } tylinespacing;
  170.  
  171.  
  172. typedef void *ptrvoid;
  173.  
  174. typedef char *ptrchar;
  175.  
  176. typedef short *ptrint;
  177.  
  178. typedef boolean (*callback) (void);
  179.  
  180. typedef    unsigned char byte, *ptrbyte;    
  181.  
  182. #define mod %
  183.  
  184. #define div /
  185.  
  186. #define abs(x) ((x) < 0? -(x) : (x))
  187.  
  188. #define odd(x) ((x) % 2)
  189.  
  190. #define even(x) (!((x) % 2))
  191.  
  192. #define max(x,y) ((x) > (y)? (x) : (y))
  193.  
  194. #define min(x,y) ((x) < (y)? (x) : (y))
  195.  
  196. #define bitboolean(fl) ((fl)?true:false)
  197.  
  198. #define isnumeric(x) ((x >= '0') && (x <= '9'))
  199.  
  200. #define longsizeof(x) (long)sizeof(x)
  201.  
  202.  
  203.